//
//  PotentialTableViewCell.swift
//  HuaYun
//
//  Created by enghou on 2018/10/11.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

import UIKit

class PotentialTableViewCell: UITableViewCell {

    override func awakeFromNib() {
        super.awakeFromNib()
//        self.detailLabel.preferredMaxLayoutWidth = 50
        // Initialization code
    }
    
    var _model: JSON?
    
    var model: JSON? {
        set{
            _model = newValue
            titleLabel.text = "你好"
            if let name =  _model?.contents?["name"]?.rawString(){
                titleLabel.text = name
                if let customerUnit = _model?.contents?["customerUnit"]?.rawString() {
                    detailLabel.text = customerUnit
                }
            } else if let contractname = _model?.contents?["contractname"]?.rawString() {
                titleLabel.text = contractname
                if let customerconpany = _model?.contents?["customerconpany"]?.rawString() {
                    detailLabel.text = customerconpany
                }
            } else if let contractName = _model?.contents?["contractName"]?.rawString() {
                titleLabel.text = contractName
                if let customerconpany = _model?.contents?["customerConpany"]?.rawString() {
                    detailLabel.text = customerconpany
                }
            }
        }
        
        get{
            return _model
        }
    }
    

    @IBOutlet weak var titleLabel: UILabel!
    
    @IBOutlet weak var detailLabel: UILabel!
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
